home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1998 January: Mac OS SDK / Dev.CD Jan 98 SDK1.toast / Development Kits (Disc 1) / QuickDraw 3D / Samples / SampleCode / BoxPaint+ - non stereo / BoxPaint+ Notes < prev    next >
Encoding:
Text File  |  1997-08-14  |  2.0 KB  |  42 lines  |  [TEXT/ttxt]

  1. BoxPaint+ :
  2.  
  3. an Example of UV picking, Hit Path Traversing, Hit Surface Normal Usage, and XYZ positioning.
  4.  
  5. Thanks to Nick Thompson and Robert Dierkes for donating drawing, and shell code.
  6.  
  7. Notes:
  8.  
  9. The 3 most interesting files are BoxPaint_Document, BoxPaint_Texture, and BoxPaint_Cursor3D. The texture and cursor files in particular contain code that I've tried to make as reusable as possible.
  10.  
  11. This source code should not be used as an example of good error detection. While in some parts, return values are checked regularly, on the whole, there is much room for improvement.
  12.  
  13. The code is also commented on just about every other line so it should be a good reference on how to do things.
  14.  
  15. STRUCTURAL STYLE:
  16.  
  17. • With the exception of Document, the format for the objects is as follows:
  18. _Init        - zeros out or defaults all values in the object data structure
  19. _New        - allocates all the memory needed for the object. Calls _Init.
  20. _Delete        - deallocates all the memory associated with the object.
  21.  
  22. It's really been kept to the same naming style that QuickDraw™ 3D uses.
  23.  
  24. • The function Document_DrawOnTexture in contains all the code relating to picking.
  25.  
  26. HOW TO MAKE CURSORS:
  27.  
  28. You can make any model you want into a cursor. Keep in mind that the origin is assumed to be the "hot spot" and that your model should be pointing in the direction of the positive Z axis. So, most of your cursor will be defined in -Z space. This is in accordance with the Camera Placement structure which points along those axis as well.
  29.  
  30. FUN:
  31.  
  32. • The Cursor is transparent when Hardware Acceleration is used.
  33. • As you may have noticed, you've actually been drawing on a sphere (oops!). You can change the geometry from a Sphere to a Box by #define BOX in BoxPaint_Support.c
  34. • Since you can pass any model you create into the Cursor3D_New function, try passing in the model of the object you are editing (**theDocument).fModel. You can watch the texture update on the cursor as you edit the model.
  35.  
  36. Have Fun !
  37.  
  38. Questions?
  39.  
  40. devsupport@apple.com
  41.  
  42. - Michael Bishop, Sept. 5th 1996